package cn.admin.system.config.infrastructure.repository.repository.impl;

import cn.admin.system.config.infrastructure.repository.entity.SysConfig;
import cn.admin.system.config.infrastructure.repository.mapper.SysConfigMapper;
import cn.admin.system.config.infrastructure.repository.repository.SysConfigRepository;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author YJ
 * @DateTime 2023/2/21 17:33
 */
@Service
public class SysConfigRepositoryIml implements SysConfigRepository {

    @Autowired
    private SysConfigMapper sysConfigMapper;

    @Override
    public SysConfig selectSysConfig(String key) {
        return sysConfigMapper.selectOne(new QueryWrapper<SysConfig>().lambda()
                .eq(SysConfig::getConfigKey,key));
    }
}
